<template>
  <div class="container-app">

    <div>
      <el-button class="full-screen" type="primary" icon="el-icon-full-screen" @click="tableFullScreen" plain>全屏展示</el-button>
    </div>

    <div style="text-align:center;font-size: 50px;">
      <b>轧线工艺要点展示台</b>
    </div>

    <table>
      <thead>
      <tr>
        <th style="width: 25%;text-align: center;">类别</th>
        <th style="text-align: center">工艺要点</th>
      </tr>
      </thead>
      <tbody>
      <tr v-for="(row, index) in dashBoardList" :key="index">
        <td>
          <tr class="category-item">订单号：{{ row.order_no }}</tr>
          <tr class="category-item">区域：{{ row.region_name }}</tr>
          <tr class="category-item">钢种：{{ row.steel_grade }}</tr>
          <tr class="category-item">宽度：{{ row.width_low }} - {{ row.width_hi }}</tr>
          <tr class="category-item">厚度：{{ row.thickness_low }} - {{ row.thickness_hi }}</tr>
        </td>
        <td v-html="row.process ? row.process.replace(/\n/g, '<br>') : ''"></td>
      </tr>
      </tbody>
    </table>
  </div>
</template>

<script>
import { listDashBoard } from "@/api/showcase/showcase_1580/dashBoard1580";

export default {
  name: "largeScreen1580",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 总条数
      total: 0,
      // 工艺要点管理 表格数据
      dashBoardList: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 20,
        currentUser: sessionStorage.getItem("currentUser"),
      },
    };
  },

  created() {
    this.getList();
  },

  methods: {
    /** 查询展示台 列表 */
    getList() {
      this.loading = true;
      listDashBoard(this.queryParams).then(response => {
        this.dashBoardList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },

    //表格全屏
    tableFullScreen(){
      window.open(this.$router.resolve({ name: 'largeScreen-fullscreen1580' }).href, '_blank'); //在新页面打开
    },

  }
};
</script>

<style scoped>
table{
  width: 100%;
  margin: 10px;
}
table, th, td {
  border: 1px solid black;
  border-collapse: collapse;
  padding: 10px;
  text-align: left;
}

th {
  font-size: 24px;
  font-weight: bold;
}

td {
  font-size: 22px;
}


.container-app {
  width: 100%;
  height: 100%;
  margin: auto;
}

.full-screen{
  margin: 10px 0 0 10px;
}
</style>
